<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<link type="text/css" href="/css/1pxtable.css" rel="Stylesheet" />	
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script language ="javascript"> 
function dataCheck(){
	if(document.getElementById('checkbox').checked){
		$("#next").prop('disabled', false);
	}else{
		$("#next").prop('disabled', true);
	}
}
function toggle(source) {
  checkboxes = document.getElementsByTagName('input');
  for(var i in checkboxes)
  	checkboxes[i].checked = source.checked;
  if(source.checked){
  	$("#next").prop('disabled', false);
  }else{
	$("#next").prop('disabled', true);
  }
}

</script>
</head>

<body>
<h1>Not Handle List<br/></h1>
<?php $payrollType = unserialize(PAYROLL_TYPE);
	  $stfDetail = new Model_DbTable_Roster_Stafflogindetail();
	  $stfInfo = new Model_DbTable_Roster_Staffinfo();?>
<h2>Payroll cycle (<?php echo $this->dateStart;?> - <?php echo $this->dateEnd;?>)<br/></h2>
<hr width=100% size=1></hr>
<h2>Change Type</h2><br />
<form action = "" method = "post" enctype="multipart/form-data" id = "myform">

<input type = "checkbox" name = "checkall" id = "checkall" style= "margin-left:720px;" onclick="toggle(this)">Check All</input>
<table width="800" border="1" cellspacing="0" cellpadding="10">
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Staff</th>
    <th scope="col">Old Type</th>
    <th scope="col">New Type</th>
    <th scope="col">Effective Date</th>
    <th scope="col">Check</th>
  </tr>
<?php foreach($this->typeList as $kt => $vt){
	   $ni = $stfDetail->getDetail($vt['id_staff']);?>  
  <tr>
    <td><?php echo $vt['id_staff']?><input type = "hidden" name = "id_staff1[<?php echo $kt;?>]" id = "id_staff1[<?php echo $kt;?>]" value = "<?php echo $vt['id_staff']?>"></input></td>
    <td><?php echo $vt['first_name']." ".$vt['last_name']?> ( <?php echo $ni['ni']?> )</td>
    <td><?php echo $payrollType[$vt['old_id_package']][0]?></td>
    <td><?php echo $payrollType[$vt['id_package']][0]?></td>
    <td><?php echo $vt['new_package_date']?></td>
    <td><input type = 'checkbox' name = 'checksign1[<?php echo $kt;?>]' id = 'checksign1[<?php echo $kt;?>]'></input></td>
  </tr>
<?php }?>  
</table>
<h2><br />
  Change Rate<br />
</h2>
<table width="800" border="1" cellspacing="0" cellpadding="10">
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Staff</th>
    <th scope="col">Old Rate</th>
    <th scope="col">New Rate</th>
    <th scope="col">Package</th>
    <th scope="col">Effective Date</th>
    <th scope="col">Check</th>
  </tr>
  
<?php foreach($this->rateList as $kr => $vr){
		$ni = $stfDetail->getDetail($vr['id_staff']);?>  
  <tr>
    <td><?php echo $vr['id_staff']?><input type = "hidden" name = "id_staff2[<?php echo $kr;?>]" id = "id_staff2[<?php echo $kr;?>]" value = "<?php echo $vr['id_staff']?>"></input></td>
    <td><?php echo $vr['first_name']." ".$vr['last_name']?>( <?php echo $ni['ni']?> )</td>
    <td><?php echo $vr['old_rate']?></td>
    <td><?php echo $vr['new_rate']?></td>
    <td><?php echo $payrollType[$vr['id_package']][0]?></td>
    <td><?php echo $vr['new_rate_date']?></td>
    <td><input type = 'checkbox' name = 'checksign2[<?php echo $kr;?>]' id = 'checksign2[<?php echo $kr;?>]'></input></td>
  </tr>
<?php }?> 
  
  
</table>
<p>&nbsp; </p>
<h2>Leave , FinalPayment<br />
</h2>
<table width="800" border="1" cellspacing="0" cellpadding="10">
  <tr>
    <th scope="col">ID</th>
    <th scope="col">Staff</th>
    <th scope="col">Package</th>
    <th scope="col">Leave Date</th>
    <th scope="col">SET TO LEFT</th>
    <th scope="col">Check</th>
  </tr>
<?php foreach($this->leaveList as $kl => $vl){
		$ni = $stfDetail->getDetail($vl['id_staff']);?>  
  <tr>
    <td><?php echo $vl['id_staff']?><input type = "hidden" name = "id_staff3[<?php echo $kl;?>]" id = "id_staff3[<?php echo $kl;?>]" value = "<?php echo $vl['id_staff']?>"></input></td>
    <td><?php echo $vl['first_name']." ".$vl['last_name']?> ( <?php echo $ni['ni']?> )</td>
    <td><?php echo $payrollType[$vl['id_package']][0]?></td>
    <td><?php echo $vl['leave_date']?></td>
    <td><?php  echo ($vl['leave']==9)?"YES":"NO"; ?></td>
    <td><input type = 'checkbox' name = 'checksign3[<?php echo $kl;?>]' id = 'checksign3[<?php echo $kl;?>]'></input></td>
  </tr>
<?php }?> 
</table>
<p>&nbsp; </p>
<h2>None login in this period</h2>
<table width="300" border="1" cellspacing="0" cellpadding="10">
	<tr>
	 	<th scope="col">ID</th>
     	<th scope="col">Staff</th>
	</tr>
	
	<?php foreach($this->nonLoginList as $kn => $vn){
			$ni = $stfInfo->getStaffinfo($vn['id']);?> 
	<tr>
		<td><?php echo $vn['id']?></td>
		<td><?php echo $ni['first_name']." ".$ni['last_name']?>( <?php echo $vn['ni']?> )</td>
	</tr>
	<?php }?>
	
	

</table>
<p>&nbsp; </p>

<div id = "payrollWizard" <?php if(!$this->nextCheck){?>style = "visibility:hidden;<?php }?>">
<input type = "checkbox" name = "checkbox" id = "checkbox" onchange = "dataCheck()">I have fully read and understanding</input>
<input type = "submit" name = "next" id = "next" value = "Next" style= "margin-left:500px;" disabled></input>
</div>
</form>
</body>
</html>
